﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;

namespace Sharpimeter.Model
{

    class DatabaseConnection
    {

    private static MySqlConnection instance = null;

    public static MySqlConnection Instance
    {
        get
        {
            if (instance == null)
            {
                Config config = new Config();
                instance = new MySqlConnection("server="+config.GetDatabaseAddress()+";userid="+config.GetDatabaseUsername()+";password="+config.GetDatabasePassword()+";database="+config.GetDatabaseName());
            }
            return instance;
        }
    }


    }
}
